package com.ruoyi.config;

import com.ruoyi.interceptor.DeleteRequestInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private DeleteRequestInterceptor deleteRequestInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(deleteRequestInterceptor)
                .addPathPatterns("/**"); // 可以指定拦截的路径模式，这里表示拦截所有请求
    }
}
